function checkuse() {
        var check;
        var partten =   /^[a-zA-Z0-9_-]{6,18}$/;
        var username = document.getElementById("username").value;
        if (username.length>18 || username.length<6){
            
            check = false;
        }
        else if(!partten.test(username)){
            
            check = false;
        }else {
        	
            check = true;
        }
        return check;
    }
    function checkpwd() {
        var check;
        var pass = document.getElementById("passw").value;
        var pattern = /^[\@A-Za-z0-9\!\#\$\%\^\&\*\.\~]{6,18}$/;
        if(pass.length<6 ||pass.length>18 ){
            
            check = false;
        }
        if(!pattern.test(pass)){
            
            check = false;
        }else {
        	
            check = true;

        }
        return check;
    }
    
function check(){
		var check=checkuse()&&checkpwd();
		return check;
		
}
